<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
<title>Book Movie History</title>
	<link type="text/css" rel="stylesheet" href="css/dth.css" />
	<style>
.menu7 {
	box-shadow: 6px 11px 10px;
}

.admin_menu_book_moive_history {
	background: #0FD1D1 !important;
}

.myTable td:nth-child(6) {
	width: 50px;
	text-align: center;
}
</style>
</h:head>

<h:body>
	<p:ajaxStatus
		style="bottom: 68%;
	    height: 32px;
	    position: fixed;
	    right: 50%;
	    width: 32px;
	    z-index: 99999;">
		<f:facet name="start">
			<p:graphicImage value="images/loading.gif" />
		</f:facet>

		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<p:growl id="growl" showDetail="true" sticky="false" />
	<ui:insert name="header">
		<ui:include src="/header/header_dth.xhtml" />
	</ui:insert>
	<div>
		<div class="dth_body_home">
			<ui:insert name="header_banner">
				<ui:include src="/header/header_banner.xhtml" />
			</ui:insert>
			<div class="dth_content">
				<div class="dth_admin_menu">
					<h:form rendered="#{loginBean.role==1}">
						<ui:insert name="header_banner">
							<ui:include src="/header/menu_admin.xhtml" />
						</ui:insert>
					</h:form>
				</div>
				<div class="dth_content_admin">
					<div class="menu_top1">

						<h:outputText value="#{msg['menu_admin_book_movie']}"
							style="margin-left:5px;font-size: 20px;font-weight: bold;"></h:outputText>
						<div style="width: 200px; height: 100%; float: right;">
							<h:form>
								<p:selectOneMenu value="#{ordermoviebean.status}"
									style="width:100%;">

									<f:selectItem itemLabel="#{msg['book_movie_unpaid']}" itemValue="0" />
									<f:selectItem itemLabel="#{msg['book_movie_paid']}" itemValue="1" />
									<f:selectItem itemLabel="#{msg['book_movie_all']}" itemValue="2" />
									<p:ajax event="change"
										listener="#{ordermoviebean.changeUserChooser}"
										update=":mainform"></p:ajax>
								</p:selectOneMenu>
							</h:form>
						</div>
					</div>
					<div class="dth_admin_main" style="font-size: 20px">
						<h:panelGroup id="mainform" rendered="#{loginBean.role==1}">
							<h:form>
								<p:dataTable var="item" styleClass="myTable" paginator="true"
									rows="15" paginatorPosition="bottom"
									paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									value="#{ordermoviebean.listBookMovies}" rowIndexVar="row">
									<p:column headerText="Stt" style="width:20px">
										<h:outputText value="#{row+1}" />
									</p:column>
									<p:column headerText="#{msg['book_movie_name']}" style="width:120px">
										<h:outputText style="float:left;"
											value="#{item.ownMovie.movieName}">
										</h:outputText>
									</p:column>
									<p:column headerText="#{msg['book_movie_username']}">
										<h:outputText style="float:left;"
											value="#{item.ownUserMovie.customerName}">
										</h:outputText>
									</p:column>
									<p:column headerText="#{msg['book_movie_price']}">
										<h:outputText style="float:left;"
											value="#{item.ownMovie.priceStr}$">
										</h:outputText>
									</p:column>
									<p:column headerText="#{msg['book_movie_book_date']}">
										<h:outputText style="float:left;" value="#{item.dateInsert}">
										</h:outputText>
									</p:column>
									<p:column headerText="#{msg['book_movie_time']}">
										<h:outputText style="float:left;" value="#{item.movieTime}">
										</h:outputText>
									</p:column>
									<p:column headerText="#{msg['book_movie_status']}">
										<h:outputText style="float:left;" value="#{msg['book_movie_paid']}"
											rendered="#{item.status==1}" />
										<h:outputText style="float:left;" value="#{msg['book_movie_unpaid']}"
											rendered="#{item.status==0}" />
									</p:column>
									<p:column headerText="#{msg['menu_action']}">
										<h:panelGroup>
											<p:commandLink onclick="confirm_del_BM.show()"
												style="margin-left:40%"
												update=":form_confirm_delete_BM:data">
												<f:param value="delete2" name="action"></f:param>
												<f:param value="#{item.id}" name="id"></f:param>
												<img src="images/icon_delete.png" title="#{msg['btn_delete']}" />
											</p:commandLink>
										</h:panelGroup>
									</p:column>
								</p:dataTable>
							</h:form>
						</h:panelGroup>
					</div>
				</div>
			</div>
		</div>
	</div>

	<h:form id="form_confirm_delete_BM" rendered="#{loginBean.role==1}">
		<p:confirmDialog id="confirm_del_BM"
			message="#{msg['delete_mess']}" header="#{msg['book_movie_delete_header']}"
			width="400" showEffect="clip" closable="false"
			widgetVar="confirm_del_BM">
			<h:panelGroup id="data">
				<h:inputHidden value="#{ordermoviebean.id}"></h:inputHidden>
				<div class="feild-action">
					<p:commandButton value="#{msg['btn_yes']}" action="#{ordermoviebean.delete}"
						oncomplete="confirm_del_BM.hide()" update=":mainform,:growl"></p:commandButton>
					<p:commandButton value="#{msg['btn_no']}" onclick="confirm_del_BM.hide()"></p:commandButton>
				</div>
			</h:panelGroup>
		</p:confirmDialog>
	</h:form>
	<ui:insert name="header">
		<ui:include src="/footer/footer_dth.xhtml" />
	</ui:insert>

</h:body>
</html>